import Vue from 'vue'
import App from './App.vue'
import "./style/reset.less"
import router from "./router"
import axios from "@/utils/request.js";

import {
    Button,
    Toast,
    Cell,
    CellGroup,
    NavBar,
    Icon,
    Image as VanImage,
    Uploader,
    Loading,
    Dialog,
    Field,
    Tab,
    Tabs,
    PullRefresh,
    List,
} from "vant"

Vue.use(Button);
Vue.use(Toast);
Vue.use(Cell);
Vue.use(CellGroup);
Vue.use(NavBar);
Vue.use(Icon);
Vue.use(VanImage);
Vue.use(Uploader);
Vue.use(Loading);
Vue.use(Dialog);
Vue.use(Field);
Vue.use(Tab);
Vue.use(Tabs);
Vue.use(PullRefresh);
Vue.use(List);


Vue.config.productionTip = false

// 拼接过滤器
Vue.filter("joinPath", function(val) {
    // 判断路径是否为完整路径
    if (val && val.indexOf("http") != -1) {
        return val
    }
    return axios.defaults.baseURL + val
})

new Vue({
    router,
    render: h => h(App),
}).$mount('#app')